package com.pubinfo.passbook.engine.process.temporary;

import com.pubinfo.passbook.engine.constants.ComputeChainType;
import com.pubinfo.passbook.engine.constants.ComputeParamType;
import com.pubinfo.passbook.engine.constants.ComputeResultType;
import com.pubinfo.passbook.engine.process.ParamenterProcessor;

import java.math.BigDecimal;

/**
 * 临时值处理器
 *
 * @author zhouch
 * @date 2021/12/16 14:11
 */
public class TemporaryProcessor extends ParamenterProcessor<Object, BigDecimal> {

    private final BigDecimal value;

    public TemporaryProcessor(BigDecimal value) {
        this.value = value;
    }

    @Override
    public BigDecimal get(Object _) {
        return value;
    }

    @Override
    public String getResultType() {
        return ComputeResultType.NUMBER;
    }

    @Override
    public String getChainType() {
        return ComputeChainType.COMMON;
    }

    @Override
    public String getType() {
        return ComputeParamType.TEMPORARY;
    }
}
